﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq;
using System.Data.Linq.Mapping;

namespace libSyllabus.Model
{
    /// <summary>
    /// This is the SectionType table entity class.
    /// </summary>
    [Table(Name = "SectionTypes")]
    public sealed class SectionTypeEntity : EntityBase
    {
        #region Constants

        // Column Name Constants
        private const string SECTIONTYPE_ID = "ID";
        private const string SECTIONTYPE_NAME = "Title";

        #endregion

        #region Constructors

        public SectionTypeEntity()
        {

        }

        #endregion

        #region Fields

        // Fields mapped to the database
        [Column(Name = SECTIONTYPE_ID, IsPrimaryKey = true, CanBeNull = false,
            IsDbGenerated = true, DbType = "INT NOT NULL Identity", AutoSync = AutoSync.OnInsert)]
        private Int32 m_id;

        [Column(Name = SECTIONTYPE_NAME, CanBeNull = false)]
        private String m_title;

        #endregion

        #region Properties

        public Int32 ID
        {
            get { return m_id; }
        }

        public String Title
        {
            get
            {
                return m_title;
            }
            set
            {
                if (m_title != value)
                {
                    RaisePropertyChanging(SECTIONTYPE_NAME);
                    m_title = value;
                    RaisePropertyChanged(SECTIONTYPE_NAME);
                }
            }
        }

        #endregion

    }
}
